<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %>
<%@include file="/quick/include/common.jsp"%>
<c:set var="buttons">
   <input type="button" style="margin-right: 5px"   onclick="f_excel()" value="<fmt:message key="button.excel"/>"/>
    <input type="button" style="margin-right: 5px"   onclick="f_query()" value="<fmt:message key="button.query"/>"/>
    <input type="button" style="margin-right: 5px"   onclick="f_print()" value="<fmt:message key="button.print.dropout.approval"/>"/>
<c:if test='${not empty model.parentId}'>
    <input type="button" style="margin-right: 5px"   onclick="f_back()" value="<fmt:message key="button.back"/>"/>
</c:if>
</c:set>
<div id='toolbar' style="display:none">
<c:out value="${buttons}" escapeXml="false"/>
</div>
<script>
Ext.onReady(globalScope._ready);
 
   

<c:if test='${not empty model.parentId}'>
function f_back(){
   history.back();
}
</c:if>
function f_excel(){
  globalScope._exportExcel();
//  globalScope._excel();
}

function f_print(){
  var tableName=globalScope.getTableName(tableName);
  var sno='%';
  var r=globalScope.grid.get(tableName).getSelectionModel().getSelected();
  if(!Ext.isEmpty(r)){
    sno=r.get('STUDENT_NO');
  }

  var matrix=[['jasper','/web-inf/pages/score/warning/quit/dropout_approval.jasper'],['params','STUDENT_NO[$]'+sno],['params','YEAR_SEMESTER[$]2010/2011学年第一学期']];
  var form=createForm(g_rootPath+'pdf/print.html',matrix);
  form.target="_blank";
  form.submit();
}

function f_query(tableName){
    globalScope._query(tableName);
}
function f_gotoPage(pageNo,rowsOfPage,pageCount,rowCount,conditoin){
  globalScope._gotoPage({spanName:"g_pageSpan_<c:out value='${model.tableName}'/>",pageNo:pageNo,rowsOfPage:rowsOfPage,pageCount:pageCount,rowCount:rowCount,condition:conditoin,tableName:"<c:out value='${model.tableName}'/>"});
}
</script>
